using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using BlueFinity.mvNET.CoreObjects;
using mvLibrary.Helpers.Utils;

namespace fenk.Varios
{
    public partial class Notas : mvLibrary.BaseForm
    {
        public Notas()
        {
            InitializeComponent();
        }
        public override void AfterSaveItem()
        {
            if (MessageBox.Show("Imprimir ahora?", "Escribir notas", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
            {
                return;
            }
            mvItem carta = new mvItem();
            carta[1] = "#" + ItemId;
            carta[2] = " ";
            carta[3] = " ";

            DateTime dateTime = DateTime.Parse(DataBASIC.OConv(textFecha.Text, "D2/"));
            carta[4] = DataBASIC.Space(30) + "Buenos Aires, " + dateTime.ToLongDateString();
            carta[5] = " ";
            carta[6] = " ";
            carta[7] = " ";
            carta[8] = " ";
            carta[9] =  UniItem.ExtractAsString(5);//nombre
            carta[10] = UniItem.ExtractAsString(2);//domicilio
            carta[11] = UniItem.ExtractAsString(4);//localidad
            carta[12] = DataBASIC.Str("-", 15);
            carta[13] = UniItem.ExtractAsString(8);
            carta[14] = " ";
            carta[15] = " ";
            int countLines = UniItem.Dcount(9);
            for (int a = 1; a <= countLines; ++a)
            {
                carta[a + 15] = UniItem.ExtractAsString(9, a);
            }
            CreatePdf(carta.ToString, 132, 72, 126, 72, "");
        }

    }
}

